<template>
	<view>
		<view class="shouye-zhuanqu">
			<view class="topimg-box"
				:style="{height:'104rpx',backgroundImage: 'url(' +zhuanquList.imgUrl+ ')',backgroundRepeat: 'no-repeat',backgroundPosition: 'center center',backgroundSize: '100% 100%'}">
				<text style="color: white;font-weight: 800;margin: 0 0 0 20rpx;">{{ zhuanquList.title }}</text>
				<view style="font-size: 26rpx;margin: 4rpx 0 0 20rpx;color:white">{{ zhuanquList.titleVice }}</view>
			</view>
			<view class="bottom-box">
				<scroll-view scroll-x="true" class="scroll-view scroll-zhuanqu">
					<view class="re_zu1 " v-for="(pro, index) in zhuanquList.product" :key="index"
						@click="$onTo('/pagesClass-rich/product/product?productId=' + pro.itemId)">
						<view style="position: relative;">
							<!-- <view class="title-img">
								热销
							</view> -->
							<image class="small-img" :lazy-load="true" mode="aspectFit" :webp="true"
								:src="getFirstImg(pro.image)">
							</image>
						</view>
						<view class="shouji-name">
							<view class="shouji-name-text">{{ pro.name }}</view>
						</view>
						<view class="re_zu_n shouji-days"><text style="font-size: 20rpx;">￥</text><text
								style="font-weight: 600;">{{ (pro.sale/pro.dayList[0].day).toFixed(2) }}</text>
							<text style="font-size: 20rpx;" v-if="pro.rentOrPurchase!=2">/天</text>
							<!-- <text style="font-size: 20rpx;" v-else>/起</text> -->
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		request,
		getUserId
	} from "@/utils"
	export default {
		name: 'bottom-types',
		props: {
			zhuanquList: {
				type: Object,
				default: {},
			}
		},
		data() {
			return {

				//下面是没用的垃圾混淆代码
				renzhengTimeSta1111111: true, //初次请求认证时间默认是带有的，
				zhuceTimeSta11111: false, //初次请求注册时间默认是没有的
				renzhengTimeList11111: [],
				zhuceTimeStaList1111: null,
				detailOrderIdStr11111: '',
				threeTabCurrent1111: 0,
				applyGOodsList11111: [], //供货商列表
				allCardEnterSta1111: false, //默认是false，点击批量卡券入库的时候变为true
				codeAddNumsList11111: [],
				numsList11111: [],
				dataSourceBqcp1111: [],
				selectedRowKeys1111: [],
				selectedRowKeysB11111: [],
				rkVisible11111: false,
				rkjlVisible1111: false,
				lhjlVisible1111: false,
				currentStyleData22222: {},
				dataSourceStyle2222: [],
				showStyleData2222: false,
				indexTemplate2222: [],
				SVGCircleElement3ee: '',
				vshoweqwsc1111: false,
				showStyleDataInfo2222: false,
				opeCategoryList2222: [],
				leimuVisible2222: false,
				selectedRowKeys02222: [],
				selectionRows02222: [],
				selectedRowKeys133333: [],
				selectionRows13333: [],
				selectedRowKeys2333: [],
				selectionRows23333: [],
				selectedRowKeys33333: [],
				selectionRows33333: [],
				selectedRowKeys4333: [],
				selectionRows43333: [],
				curwfqwrentStyleDaterwaInfo444: {},
				currwerentStywerleDatweraInfo1444: {},
				currewerntStyleDataInfo24444: {},
				currentweStyleDytuataIwenfo34444: {},
				currenwetStdfgyleDataInfo44444: {},
				checkZfbPhone_h5444: '',
				plNafgdvfdtjyme4444: '', //四大品类的名字
				uniPdfgrtylatform444: '', //运行环境mp-alipay mp-weixin
				refgjtytrsemark555: '', //备注
				timefgjSelStr5555: '', //选择的上门时间（2023-08-31 00:00:00）
				amOdcuiofasrpm5555: '', //选择的上门时间是上午还是下午
				pageShnjlkgohowTime5555: '', //页面上用户看到的显示的时间
				paraghsdfmsw454: {},
				valhgujtueNum56756: 0,
				addrdraess56756: {}, //上门收货地址
				adawerterydressId575: 0,
				sceoyuitne57567: '',
				tntuiopId56757: '',
				weictyuratCustomer5756: '',
				yuidurtyuoy567567: false,
			}
		},
		components: {},
		created() {
			// this.getHotPageProduct()
		},
		mounted() {
			console.log('首页传给商品专区的数据', this.zhuanquList);
		},

		methods: {
			getFirstImg(imgsStr) {
				return imgsStr.split(',')[0]
			},
		},
	}
</script>

<style lang="scss" scoped>
	.shouye-zhuanqu {
		// @include fj()
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin: 10rpx 0;
		overflow: hidden;

		// background-color: red;
		.topimg-box {
			overflow: hidden;
			position: relative;
			width: 96%;
			display: flex;
			flex-direction: column;
			justify-content: center;


			// .xuanchuan {
			// 	position: absolute;
			// 	top: 20rpx;
			// 	left: 30rpx;
			// 	z-index: 99;

			// 	.title {
			// 		>text:nth-child(1) {
			// 			font-weight: 800;
			// 		}

			// 		>text:nth-child(2) {
			// 			display: inline-block;
			// 			width: 70rpx;
			// 			height: 25rpx;
			// 			border-radius: 5rpx;
			// 			line-height: 25rpx;
			// 			font-size: 26rpx;
			// 			font-weight: 800;
			// 			text-align: center;
			// 			background: linear-gradient(to right, #cdd2de, #5a658c);
			// 			margin-left: 20rpx;
			// 		}
			// 	}
			// }
		}

		.bottom-box {
			width: 707rpx;
			// overflow: hidden;
			// background-color: red;
			display: inline-block;
		}

		.topimg {
			width: 100%;
			height: 104rpx;
		}

		::-webkit-scrollbar {
			display: none;
			width: 0 !important;
			height: 0 !important;
			-webkit-appearance: none;
			background: transparent;
			color: transparent;
		}

		.scroll-zhuanqu {
			overflow: hidden;
			white-space: nowrap;
			display: flex;
			background-color: #ffffff;
			border-radius: 0 0 20rpx 20rpx;
			margin-top: -12rpx;
			white-space: nowrap;
		}

		.re_zu1 {
			width: 30%;
			// width: 600rpx;
			display: inline-block;
			vertical-align: top;
			text-align: center;
			// height: 370rpx;
			padding-top: 5px;
			border-radius: 10px;
			margin-left: 12px;

			image {
				border-radius: 5px;
			}

			.small-img {
				width: 200rpx;
				height: 200rpx;
				margin-top: 20rpx;
			}

			.shouji-name {
				// margin-left: 6rpx;
				// font-size: 24rpx;
				// color: #666258;
				// width: 190rpx;
				// height: 52rpx;
				// overflow: hidden;
				// text-overflow: ellipsis;
				// white-space: pre-wrap;
				// word-wrap: break-word;
				// -webkit-line-clamp: 2;
				// -webkit-box-orient: vertical;
				// display: -webkit-box;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 1;
				overflow: hidden;
				// margin-bottom: 10rpx;
				// padding-left: 20rpx;
				// padding-right: 20rpx;
				padding: 0 20rpx;
				box-sizing: border-box;

				.shouji-name-text {
					font-size: 24rpx;
					font-weight: 400;
					color: #333333;
					font-family: Arial;
					word-break: break-all;
					max-width: 100%;
					overflow: hidden;
					text-overflow: ellipsis;
					display: inline-block;
				}
			}

			.shouji-days {
				color: #FF7B2B;
				margin-bottom: 10rpx;
				// margin: 8rpx 0 8rpx 0;
			}
		}

		.ziyin-img {
			width: 70%;
			height: 40rpx;

		}

		.title-img {
			z-index: 99;
			// width: 70rpx ;
			height: 26rpx;
			line-height: 26rpx;
			text-align: center;
			font-size: 20rpx;
			color: white;
			padding: 4rpx 8rpx;
			background-color: #FF7B2B;
			border-radius: 20rpx 20rpx 20rpx 0;
			position: absolute;
			top: 12rpx;
			right: 24rpx;
		}
	}
</style>